/*******************************************************************************
 *
 * File:        STUB_PLIB.h
 * Progetto:    Robottino
 * Ambiente:    PIC32
 * Data:        14/03/2012
 * Autore:      M. Tili
 * Versione:    00.00
 *
 * Descrizione: 
 *   File di intestazione per il modulo di STUB per plib.h.
 *   Usato per la compilazione in ambiente VS Windows.
 *
 *
 * Modifica:  gg/mm/aaaa  | N.Cognome
 *                        | Descrizione modifica
 *
 */
#ifndef STUB_PLIB_H
#define STUB_PLIB_H

//#define FALSE 0x00
//#define TRUE  0x01


#define  /* BIT 00 */  BIT_0       0
#define  /* BIT 01 */  BIT_1       1
#define  /* BIT 02 */  BIT_2       2
#define  /* BIT 03 */  BIT_3       3
#define  /* BIT 04 */  BIT_4       4
#define  /* BIT 05 */  BIT_5       5
#define  /* BIT 06 */  BIT_6       6
#define  /* BIT 07 */  BIT_7       7
#define  /* BIT 08 */  BIT_8       8
#define  /* BIT 09 */  BIT_9       9
#define  /* BIT 10 */  BIT_10     10
#define  /* BIT 11 */  BIT_11     11
#define  /* BIT 12 */  BIT_12     12
#define  /* BIT 13 */  BIT_13     13
#define  /* BIT 14 */  BIT_14     14
#define  /* BIT 15 */  BIT_15     15

#define IOPORT_A    0
#define IOPORT_B    1
#define IOPORT_C    2
#define IOPORT_D    3
#define IOPORT_E    4
#define IOPORT_F    5
#define IOPORT_G    6


typedef int IO_PORT_ID;


extern void         mPORTDSetPinsDigitalOut (unsigned int _bits);
extern void         mPORTDSetPinsDigitalIn  (unsigned int _bits);
extern unsigned int mPORTDReadBits(unsigned int _bits);
extern void         mPORTDClearBits(unsigned int _bits);
extern void         mPORTDSetBits(unsigned int _bits);
extern int          SYSTEMConfig(unsigned int _bits,unsigned int _bits2);
extern void         PORTSetPinsDigitalIn(IO_PORT_ID port, unsigned int inputs);
extern void         PORTSetPinsDigitalOut(IO_PORT_ID port, unsigned int inputs);
extern void         PORTClearBits(IO_PORT_ID port, unsigned int bits);
extern unsigned int ReadCoreTimer(void);


extern unsigned char stub_led_0;
extern unsigned char stub_led_1;
extern unsigned char stub_led_2;
extern unsigned char stub_key_0;
extern unsigned char stub_key_1;
extern unsigned char stub_key_2;






#else
#error "Tentativo di inclusioni multiple STUB_PLIB_H"
#endif


